//
//  FlashStage.m
//  asinoc
//
//  Created by Colin Leung on 22/05/2010.
//  Copyright 2010 Digi3 Studio. All rights reserved.
//

#import "FlashStage.h"

@implementation FlashStage
- (id)init{
	if((self = [super init])){
		
	}
	return self;
}

- (void)drawRect:(CGRect)rect {
	CGContextRef ctx = UIGraphicsGetCurrentContext();

	float black[] = {0.0,0.0,0.0,1};
	CGContextSetFillColor(ctx, black);
	CGContextAddRect(ctx,CGRectMake(100, 100, 20, 20));
	CGContextFillPath(ctx);

	CABasicAnimation *theAnimation;	
	theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
	theAnimation.duration=1;
	theAnimation.repeatCount=2;
	theAnimation.autoreverses=YES;
	theAnimation.fromValue=[NSNumber numberWithFloat:0];
	theAnimation.toValue=[NSNumber numberWithFloat:-60];
	[self.layer addAnimation:theAnimation forKey:@"animateLayer"];
}

- (void)dealloc {
    [super dealloc];
}

@end
